fba66a
@@ -351,9 +351,7 @@
public class SplitLogManager extends ZooKeeperListener {
             } else {
               task.batch.error++;
             }
-            if ((task.batch.done + task.batch.error) == task.batch.installed) {
-              task.batch.notify();
-            }
+            task.batch.notify();
           }
         }
       }
@@ -607,9 +605,9 @@
public class SplitLogManager extends ZooKeeperListener {
     // a single thread touches batch.installed.
     oldtask = tasks.putIfAbsent(path, new Task(batch));
     if (oldtask != null) {
+      // new task was not used.
+      batch.installed--;
       synchronized (oldtask) {
-        // new task was not used.
-        batch.installed--;
         if (oldtask.isOrphan()) {
           if (oldtask.deleted) {
             // The task is already done. Do not install the batch for this
@@ -618,12 +616,12 @@
public class SplitLogManager extends ZooKeeperListener {
             // this task to complete.
             return (null);
           }
-          LOG.info("Previously orphan task " + path +
-              " is now being waited upon");
           oldtask.setBatch(batch);
-          return (null);
         }
       }
+      LOG.info("Previously orphan task " + path +
+          " is now being waited upon");
+      return (null);
     }
     return oldtask;
   }
